package cn.edu.hizee.gps.model;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author ZX
 */
@Entity
@Table(name = "t_site", schema = "EHelp", catalog = "")
public class Site {
    private int id;
    private Integer userId;
    private String lng;
    private String lat;
    private String extra;

    public Site(Integer userId, String lng, String lat) {
        this.userId = userId;
        this.lng = lng;
        this.lat = lat;
    }

    public Site() {
    }

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "lng")
    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    @Basic
    @Column(name = "lat")
    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    @Basic
    @Column(name = "extra")
    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Site site = (Site) o;
        return id == site.id &&
                Objects.equals(userId, site.userId) &&
                Objects.equals(lng, site.lng) &&
                Objects.equals(lat, site.lat) &&
                Objects.equals(extra, site.extra);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, lng, lat, extra);
    }
}
